package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the message database table.
 * 
 */
@Embeddable
public class MessagePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="v_name")
	private String vName;

	@Column(name="t_email")
	private String tEmail;

	public MessagePK() {
	}
	public String getVName() {
		return this.vName;
	}
	public void setVName(String vName) {
		this.vName = vName;
	}
	public String getTEmail() {
		return this.tEmail;
	}
	public void setTEmail(String tEmail) {
		this.tEmail = tEmail;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MessagePK)) {
			return false;
		}
		MessagePK castOther = (MessagePK)other;
		return 
			this.vName.equals(castOther.vName)
			&& this.tEmail.equals(castOther.tEmail);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.vName.hashCode();
		hash = hash * prime + this.tEmail.hashCode();
		
		return hash;
	}
}